#define _CRT_SECURE_NO_WARNINGS 1
#include"stdio.h"
int mian()
{
    int t = 0;

    scanf("%d", &t);
    while (t--) {
        int n = 0;
        int i = 0, j = 0, count1 = 0, count2 = 0;
        scanf("%d", &n);

        char arr[n][n];
        for (i = 0; i < n; i++)
        {
            for (j = 0; j < n; j++)
            {
                scanf("%c", &arr[i][j]);
            }
        }
        for (i = 0; i < n; i++)
        {
            for (j = 0; j < n; j++)
            {
                if (arr[i][j] == 'w')
                    count1++;
                if (arr[i][j] == 'b')
                    count2++;
            }
        }
        if (count1 > count2)
            printf("FYMNB");
        else
            printf("DDNB");
    }
    return 0;
}